﻿using System;
using System.Data;
using System.Data.Common;
using Hxj.Data;
using Hxj.Data.Common;

namespace RecruitStudents.Utility.Model
{

	/// <summary>
	/// 实体类TB_Sys_RoleAuth 。(属性说明自动提取数据库字段的描述信息)
	/// </summary>
	[Serializable]
	public class TB_Sys_RoleAuth : Entity 
	{
		public TB_Sys_RoleAuth():base("TB_Sys_RoleAuth") {    _ModuleID=Guid.NewGuid().ToString();}

		#region Model
		private string _RoleID;
		private string _ModuleID;
		/// <summary>
		/// 角色ID
		/// </summary>
		public string RoleID
		{
			get{ return _RoleID; }
			set
			{
				this.OnPropertyValueChange(_.RoleID,_RoleID,value);
				this._RoleID=value;
			}
		}
		/// <summary>
		/// 系统类库ID
		/// </summary>
		public string ModuleID
		{
			get{ return _ModuleID; }
			set
			{
				this.OnPropertyValueChange(_.ModuleID,_ModuleID,value);
				this._ModuleID=value;
			}
		}
		#endregion

		#region Method
		/// <summary>
		/// 获取实体中的主键列
		/// </summary>
		public override Field[] GetPrimaryKeyFields()
		{
			return new Field[] {
				_.RoleID,
				_.ModuleID};
		}
		/// <summary>
		/// 获取列信息
		/// </summary>
		public override Field[] GetFields()
		{
			return new Field[] {
				_.RoleID,
				_.ModuleID};
		}
		/// <summary>
		/// 获取值信息
		/// </summary>
		public override object[] GetValues()
		{
			return new object[] {
				this._RoleID,
				this._ModuleID};
		}
		/// <summary>
		/// 给当前实体赋值
		/// </summary>
		public override void SetPropertyValues(IDataReader reader)
		{
			this._RoleID = DataUtils.ConvertValue<string>(reader["RoleID"]);
			this._ModuleID = DataUtils.ConvertValue<string>(reader["ModuleID"]);
		}
		/// <summary>
		/// 给当前实体赋值
		/// </summary>
		public override void SetPropertyValues(DataRow row)
		{
			this._RoleID = DataUtils.ConvertValue<string>(row["RoleID"]);
			this._ModuleID = DataUtils.ConvertValue<string>(row["ModuleID"]);
		}
		#endregion

		#region _Field
		/// <summary>
		/// 字段信息
		/// </summary>
		public class _
		{
			/// <summary>
			/// * 
			/// </summary>
			public readonly static Field All = new Field("*","TB_Sys_RoleAuth");
			/// <summary>
			/// 角色ID
			/// </summary>
			public readonly static Field RoleID = new Field("RoleID","TB_Sys_RoleAuth","角色ID");
			/// <summary>
			/// 系统类库ID
			/// </summary>
			public readonly static Field ModuleID = new Field("ModuleID","TB_Sys_RoleAuth","系统类库ID");
		}
		#endregion


	}
}

